/**
 * 
 */
package com.lehecai.core.type.sms;

import com.lehecai.core.IntegerBeanLabelItem;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * 短信通道
 * @author leiming
 *
 */
public class SmsChannel extends IntegerBeanLabelItem {
	private static final long serialVersionUID = 3263255480832149523L;

	private static final Logger logger = LoggerFactory.getLogger(SmsChannel.class.getName());
	
	private static List<SmsChannel> items = new ArrayList<SmsChannel>();
	
	protected SmsChannel(String name, int value) {
		super(SmsChannel.class.getName(), name, value);
		
		items.add(this);
	}
	
	public static SmsChannel getItem(int value){
		try {
			return (SmsChannel)SmsChannel.getResult(SmsChannel.class.getName(), value);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			return null;
		}
	}
	
	public static List<SmsChannel> getItems() {
		return items;
	}

	public static final SmsChannel CSMD = new SmsChannel("创世漫道", 1);
	public static final SmsChannel SQT = new SmsChannel("社区通", 2);
    public static final SmsChannel YUNPIAN = new SmsChannel("云片", 3);

}
